package com.woniu.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.commons.exception.YogaException;
import com.woniu.dao.mapper.YGoodsItemMapper;
import com.woniu.model.model.YGoodsItem;
import com.woniu.service.YGoodsItemService;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 胡歌
 * @since 2024年05月28日
 */
@Service
public class YGoodsItemServiceImpl extends ServiceImpl<YGoodsItemMapper, YGoodsItem> implements YGoodsItemService {

    @Resource
    private YGoodsItemMapper goodsItemMapper;



    /**
     * 通过订单ID查询多个订单信息
     * @param orderNum 订单编号
     * @return
     * @throws YogaException
     */
    @Override
    public List<YGoodsItem> listByClassType(String orderNum) throws YogaException {
        QueryWrapper<YGoodsItem> wrapper = new QueryWrapper<>();
        wrapper.eq("order_num",orderNum);
        List<YGoodsItem> goodsItems = goodsItemMapper.selectList(wrapper);
        return goodsItems;
    }



}
